import FoodTruckItem from "../FoodTruckItem";
import classes from "./index.module.css";
const FoodTruckList = (props) => {
  const { items, toggleLike, toggleCollect } = props;
  return (
    <ul className={classes.list}>
      {items?.map((item) => (
        <FoodTruckItem
          key={item.id}
          id={item.id}
          isCollected={item.isCollected}
          likeNum={item.likeNum}
          collectNum={item.collectNum}
          applicant={item.applicant}
          isLiked={item.isLiked}
          cnn={item.cnn}
          address={item.address}
          foodItems={item.foodItems}
          image={item.image}
          toggleLike={toggleLike}
          toggleCollect={toggleCollect}
        />
      ))}
    </ul>
  );
};

export default FoodTruckList;
